package com.study.stream;

import com.fasterxml.jackson.annotation.JsonInclude;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import lombok.ToString;
import lombok.experimental.Accessors;

import java.io.Serializable;

/**
 * @author study
 * @version 1.0
 * @date 2020/6/16 0:28
 */
@Data
@AllArgsConstructor
@NoArgsConstructor
@ToString
@Accessors(chain = true)
@JsonInclude(JsonInclude.Include.NON_EMPTY) // 设置不为空的时候返回
@ApiModel(value = "ffmpeg任务", description = "ffmpeg任务")
public class CmdTasker implements Serializable {
    @ApiModelProperty(value = "ffmpeg任务ID")
    private String id;// 任务id
    @ApiModelProperty(value = "ffmpeg任务cmd")
    private String command;//命令行
    @ApiModelProperty(value = "ffmpeg任务主进程")
    private boolean process;// 命令行运行主进程
    @ApiModelProperty(value = "命令行消息输出子线程")
    private boolean thread;// 命令行消息输出子线程

    public String type() {
        //ID 以 下划线分割
        return this.getId().split("_")[0];
    }
}
